In photography, a refractive index of a lens is wavelength-dependent, thereby causing chromatic aberrations due to different colored light being focused at different spatial locations. One variant of chromatic aberration is purple fringing, which can be observed as bluish/purplish colors in a digital image, particularly near high contrast areas where blue and red photons from brighter areas contaminate adjacent darker areas of the digital image.
Various solutions for reducing purple fringing in digital images have been proposed. One proposed solution desaturates purple areas that are adjacent to a nearly overexposed area when a value of a red channel and a value of a blue channel are each greater than a value of a green channel. Although the proposed solution reduces purple fringing, the desaturated purple areas may lose color information and appear as a shade of gray.
A second proposed solution restores the red channel and the blue channel in purple areas by calculating gradients and lines of greatest slope in all colors (red, green and blue) and interpolating a least saturated value of a red channel and a blue channel, respectively, on a dark side of a line of greatest slope, with a least saturated value of the red channel and the blue channel, respectively, on a bright side of the steep gradient. An interpolation factor is driven by a difference in value of the green channel from the dark side of the line of greatest slope, to the bright side of the line of greatest slope, However, the second proposed solution suffers from a number of problems, including being subject to noise due to being gradient sensitive.